package com.xinkao.enrollment.util.constants;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author: LXF
 * @description: 通用常量类, 单个业务的常量请单开一个类, 方便常量的分类管理
 * @date: 2017/10/24 10:15
 */
@Component
public class Constants {

	/**
	 * 返回值
	 */
	public static final String SUCCESS_CODE = "200";
	/**
	 * 成功消息
	 */
	public static final String SUCCESS_MSG = "请求成功";

	/**
	 * session中存放用户信息的key值
	 */
	public static final String SESSION_USER_INFO = "userInfo";
	/**
	 * 用户权限
	 */
	public static final String SESSION_USER_PERMISSION = "userPermission";
	/**
	 * redis的验证码默认生效时间
	 */
	public static final long VALIDATE_CODE_TIME = 10*60;
	/**
	 * redis权限头
	 */
	public static final String REDIS_PERMISSION = "smart_class_room_p_";


	/**
	 * 默认密码
	 */
	public static final String DEFAULT_PASSWORD  = "123456";
	/**
	 * 默认状态
	 */
	public static final String DEFAULT_STATUS  = "1";
	/**
	 * 默认操作人
	 */
	public static final String ADMINISTRATOR  = "admin";
	/**
	 * 默认密码加密方式
	 */
	public static final String ENCRYPTION  = "MD5";
	/**
	 * 默认密码加密次数
	 */
	public static final int TIMES  = 2;

	/**
	 * 默认角色权限关联表中全权限类型
	 */
	public static final String ALL_MENU  = "1";
	/**
	 * 默认角色权限关联表中半权限类型
	 */
	public static final String HALF_MENU  = "2";

	/**
	 * 下载模板
	 */
	public static final String TEMPLATES_EXCEL_ADDRESS="/templates/导入模板.xlsx";

	/**
	 * 获取token所需要的的头参数
	 */
	public static final String AUTH = "Authorization";

	/**
	 * 视频和图片远程地址
	 */
	public static  String REQUEST_PATH;

	@Value("${prop.request_path}")
	public void setHost(String port) {
		REQUEST_PATH = port;
	}

	/**
	 * 对比后缀
	 */
	public static String IMGSUF = "BMP,JPG,JPEG,PNG,GIF";
}
